public class test_3 {
    public static void main(String[] args) {
        int n = 20;
        double sum = 0;

        for (int i = 1; i <= n; i++) {
            sum += factorial(i);
        }
        System.out.println(sum+1);
    }
    public static double factorial(int num) {
        int result = 1;
        for (int i = 1; i <= num; i++) {
            result *= i;
        }
        return 1.0/result;
    }
}
